import Vue from 'vue'
import Router from 'vue-router'
/* 注意：这里的@指的是src目录，@/等价于../相对路径查找文件 */
import HelloWorld from '@/components/HelloWorld'
import Home from '@/pages/home/Home.vue'/**引入首页组件 */
import List from '@/pages/list/List.vue'/**引入列表页组件 */
import Download from '@/pages/download/Download'/**引入下载页组件 */
import Mine from '@/pages/mine/Mine.vue'/**引入我的页面组件 */
import Search from '@/pages/search/Search.vue'/**引入搜索页组件 */
import Account from '@/pages/account/Account'/**引入我的账户页组件 */
import Login from '@/pages/login/Login'/**引入登陆页组件 */
import Collect from '@/pages/collect/Collect'/**引入收藏页组件 */

Vue.use(Router)

export default new Router({
    routes: [
        /*{
            path: '/',
            name: 'HelloWorld',
            component: HelloWorld
        },*/
        {
            path:'/',/**默认进入路由，写在第一个 */
            redirect: '/home'/**重定向 */
        },{
            path: '/home',
            name: 'Home',
            component: Home,
            meta: { title: "美团首页" }
        },{
            path:'/list',
            name:'List',
            component:List
        },{
            path:'/download',
            name:'Download',
            component:Download,
            meta: { title: "下载APP" }
        },{
            path:'/mine',
            name:'Mine',
            component:Mine,
            meta: { title: "我的美团" }
        },{
            path:'/search',
            name:'Search',
            component:Search,
            meta: { title: "搜索" }
        },{
            path:'/account',
            name:'Account',
            component:Account,
            meta: { title: "我的账户" }
        },{
            path:'/login',
            name:'Login',
            component:Login,
            meta: { title: "登陆" }
        },{
            path:'/collect',
            name:'Collect',
            component:Collect,
            meta: { title: "我的收藏" }
        },{
            path:'/*',/**404错误页面，写到最后 */
            redirect: '/home'/**一般会重定向到首页或者404页面 */
        }
    ]
})


